<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>服装款式</title>
    <%@ include file="/WEB-INF/views/include/head.jsp"%>
    <script src="${ctxStatic}/js/jquery-1.9.1.min.js"></script>
    <script src="${ctxStatic}/js/DateTimePicker.js"></script>
    <script src="${ctxStatic}/js/layer.js"></script>
    <script src="${ctxStatic}/js/style.js"></script>
   	<script src="${ctxStatic}/dateCalendar/WdatePicker.js"></script>
    <link rel="stylesheet" href="${ctxStatic}/css/common_erp.css">
    <link rel="stylesheet" href="${ctxStatic}/css/list.css">
    <script>
$(function(){
		
		searchListForm();
		
        $(".tabBox ul li").each(function(){
            var index=$(this).index();

            $(".tabBox ul li").eq(0).addClass("active");

            $(this).click(function(){

                $(this).addClass("active").siblings().removeClass("active");
                
                $("#tabPageStatus").val($(this).val());
                searchListForm();

                $(".tabBoxSm > .tabSm").eq(index).stop(true).show().siblings().stop(true).hide();
				
				var tableW = $(".tabBoxSm > .tabSm").eq(index).find('.tableHead').width();
				var tabodyH = $(".tabBoxSm > .tabSm").eq(index).find('.tableBody').height();
				var tableScrollH = $(".tabBoxSm > .tabSm").eq(index).find('.tableScroll').height();
				if(tabodyH>tableScrollH){
					$(".tabBoxSm > .tabSm").eq(index).find('.tableScroll').css('width',tableW + 18 + 'px')
				}else{
					$(".tabBoxSm > .tabSm").eq(index).find('.tableScroll').css('width','inherit')
				}

            })

        })

    });
        //检索 
    function searchListForm() {
    	var params = $("#searchForm").serialize();
    	$("#activity_pane").showLoading();
    		$.post("${ctx}/material/outbound/searchList",params,function(result) {
				var listHtml = result["materialOutbound"];
				var pageHtml = result["page"];
				$("#listHtml").html(listHtml);
				$("#paging").html(pageHtml);
				
				var length = $("p.needRED").length;
				for (var i = 0; i < length; i++) {
					var statusVal = $(".needRED")[i].innerHTML;
					if (statusVal=="<spring:message code="outbound_request_status_no" />") {
						$("p.needRED")[i].style.cssText="color:red;";
					}
				}
				$("#activity_pane").hideLoading();
			}, 'json');
	}
        
        
	//重置
	function clean() {
		$("#inventoryRequestNo").val("");
		$("#fabricatingName").val("");
		$("#contractProcessNo").val("");
		$("#dateFrom").val("");
		$("#dateTo").val("");
		searchListForm();
	}   
    </script>
</head>
<body>
<form id="searchForm">
<div class="listArea" id="activity_pane">
	<div class="listBg">
        <div class="searchArea clearfix">
            <div class="searchLeft clearfix">
                <div class="searchInp clearfix">
                <!-- 出库单号  -->
                    <p><spring:message code="inventory_requestex_list_search_inventoryNo" /></p>
                    <input id="inventoryRequestNo"
							name="inventoryRequestNo">
                </div>
                <div class="searchInp clearfix">
                <!-- 加工厂名称  -->
                    <p><spring:message code="inventory_requestex_list_search_fabricatingName" /></p>
                 <input id="fabricatingName"
							name="fabricatingName">
                </div>
               			<div class="searchInp clearfix">
						<!-- 日期 -->
						<p>
							<spring:message code="bigcargo_date" />
						</p>
						<div class="timeBox">
							<input type="text" class="laydate-icon" onclick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd',onpicked:null})"
								id="dateFrom" name="dateFrom" style="width: 110px">
							<p class="list">~</p>
							<input type="text" class="laydate-icon" id="dateTo" name="dateTo"
								style="width: 110px" onclick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd',onpicked:null})">
						</div>
					</div>
                <div class="searchInp clearfix">
                <!-- 外发订单  -->
                    <p><spring:message code="inventory_requestex_list_search_contractProcessNo" /></p>
                    <input id="contractProcessNo"
							name="contractProcessNo">
                </div>
                            
            </div>
           
            	<div class="searchRight clearfix">
				 <shiro:hasPermission name="material:outbound:view">
					<!-- 检索 -->
					<button type="button" onclick="searchListForm()">
						<spring:message code="commom_check" />
					</button>
					</shiro:hasPermission>
					<!-- 重置 -->
					<button type="button" onclick="clean();"><spring:message code="common_reset" /></button>
					
				</div>
            </div>
            </div>
        
    <input type="hidden" id="tabPageStatus" name="tabPageStatus" value="0"/>
    
    <div class="tabBox">
        <ul class="clearfix">
            <!-- 全部 -->
            <li class="active" value="0"><spring:message code="inventory_requestex_list_tab_all"/></li>
            <!-- 待出库 -->
            <li value="1"><spring:message code="inventory_requestex_list_tab_wait" /></li>
            <!-- 已出库 -->
            <li value="2"><spring:message code="inventory_requestex_list_tab_done" /></li>
        </ul>
	</div>
   <div class="listBg tabPadding overflowX">
        <div class="tableArea tabBoxSm">
            <div class="tableScrollSm" style = "height:650px;overflow: auto;width: 1321px;">
                <table cellpadding="0" class="tableHead">
                    <thead>
                    <tr>
                    	<!-- No. -->
                        <th><p class="table-No"><spring:message code="common_no" /></p></th>
                        <!-- 出库单号 -->
                        <th><p class="width-150px"><spring:message code="inventory_requestex_list_requestNo" /></p></th>
                        <!-- 出库类别 -->
                        <th><p class="width-80px"><spring:message code="inventory_requestex_list_inventoryCategory" /></p></th>
                        <!-- 外发加工厂 -->
                        <th><p class="width-150px"><spring:message code="inventory_requestex_list_fabricatingName" /></p></th>
                        <!-- 外发订单号 -->
                        <th><p class="width-120px"><spring:message code="inventory_requestex_list_contractProcessNo" /></p></th>
                        <!-- 出库状态 -->
                        <th><p class="width-80px"><spring:message code="inventory_requestex_list_iventoryStatus" /></p></th>
                        <!-- 申请出库时间 -->
                        <th><p class="width-90px"><spring:message code="inventory_requestex_list_requestQuantity" /></p></th>
                        <!-- 实际出库时间 -->
                        <th><p class="width-90px"><spring:message code="inventory_requestex_list_realQuantity" /></p></th>
                        <!-- 经办人员 -->
                        <th><p class="width-90px"><spring:message code="inventory_requestex_list_handleUser" /></p></th>
                        <!-- 经办日期  -->
                        <th><p class="width-90px"><spring:message code="inventory_requestex_list_handleDate" /></p></th>
                        <!-- 申请人员 -->
                        <th><p class="width-90px"><spring:message code="inventory_requestex_list_requestUser" /></p></th>
                        <!-- 申请日期 -->
                        <th><p class="width-90px"><spring:message code="inventory_requestex_list_requestDate" /></p></th>
                    </tr>
                    </thead>
                </table>
                <table cellpadding="0" class="tableBody">
                    <tbody id="listHtml">
                    </tbody>
                </table>
            </div>
          
        </div>
    </div>
    <div id = "paging" ></div>
</div>
</form>
</body>
</html>
